package com.example.quartz.controller;

import com.example.common.core.page.TableDataInfo;
import com.example.quartz.domain.SysJob;
import com.example.quartz.service.ISysJobService;
import jakarta.annotation.Generated;
import jakarta.annotation.Resource;
import lombok.extern.java.Log;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 调度任务信息操作处理
 */
@RestController
@RequestMapping("/monitor/job")
public class SysJobController {

    @Resource
    private ISysJobService jobService;

    /**
     * 查询定时任务列表
     *
     * @param job
     * @return
     */
    //@PreAuthorize("@ss.hasPermi('monitor:job:list')")
    // 这是一个Spring Security的注解，用于控制权限，如果当前用户没有权限，则不允许访问此方法。
    @PreAuthorize("@ss.hasPermi('monitor:job:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysJob job) {
        startPage();
        List<SysJob> list = jobService.selectJobList(job);
        return getDataTable(list);
    }

    /**
     * 导出定时任务列表
     *
     * @param response
     * @param job
     */
    @PreAuthorize("@ss.hasPermi('monitor:job:export')")
    @GetMapping("/export")
    public void export(HttpServletResponse response, SysJob job) {

    }


}


